package com.gyy.flutter.plugin.flutter_plugin_print_a300.newprint;
import android.content.Intent
import android.os.Bundle
import com.gyy.flutter.plugin.flutter_plugin_print_a300.app.YmApp
import com.gyy.flutter.plugin.flutter_plugin_print_a300.newprint.base.PrintKey

import java.util.*

/**
 * Created by 000098 on 2019/9/23。
 * Description 配载单打印, 寄件联打印
 * 打印数据：接口获取
 * 打印模板：接口获取
 *
 * @author 000098
 */
class HMA300PrintLogic {

    /**
     * 执行打印
     */
    fun printLayout(dataMap: HashMap<String, String>?,  blueAddress: String?) {
        val startServiceIntent = Intent(YmApp.context, NewPrintService::class.java)
        val bundle = Bundle()
        bundle.putSerializable(PrintKey.DATA_JSON, dataMap)//打印的对象
        bundle.putString(PrintKey.BLUE_ADDRESS, blueAddress);
        startServiceIntent.putExtras(bundle)
        YmApp.context.startService(startServiceIntent)
    }
}